<?php

declare(strict_types=1);

namespace Plugin\Attractions\HaiKang\Model;

use Hyperf\DbConnection\Model\Model as MineModel;

/**
 * @property string $device_serial 设备序列号
 * @property string $channel_id 通道ID
 * @property string $channel_name 通道名称
 * @property string $channel_no 通道号
 * @property int $channel_status 通道状态，0：离线，1：在线，-1：设备未上报
 * @property string $channel_type 通道类型，10300:视频通道，10302：报警输入
 * @property int $is_use 通道启用状态：0-禁用；1-启用
 * @property string $ipc_serial NVR通道关联的IPC序列号
 * @property string $child_device_model NVR通道关联的IPC型号
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class HkDeviceChannel extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'hk_device_channel';

    protected string $keyType = 'string';

    protected string $primaryKey = 'device_serial';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = [
        'device_serial', 'channel_id', 'channel_name', 'channel_no', 'channel_status', 
        'channel_type', 'is_use', 'ipc_serial', 'child_device_model', 'created_at', 'updated_at'
    ];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = [
        'channel_status' => 'integer', 
        'is_use' => 'integer', 
        'channel_no' => 'integer',
        'created_at' => 'datetime', 
        'updated_at' => 'datetime'
    ];
}